{namespace lfe=SGalinski\Lfeditor\ViewHelpers}

<f:layout name="Default" />

<f:section name="selectItems">
	<f:render partial="SelectExtensionAndLanguageFile" arguments="{_all}" />
</f:section>

<f:section name="main">
	<lfe:extendedIf condition="{extensionSelection}" and="{languageFileSelection}">
		<h2 class="uppercase">
			<f:translate key="function.const.search.search" />
		</h2>
		<f:form id="contentForm" action="searchConstantSearch">
			<label>
				<f:form.checkbox id="caseSensitive" name="caseSensitive" value="1" checked="{searchCaseSensitive}"
					class="tx-lfeditor-checkBox-bottom" />
				<f:translate key="function.search.caseSensitiveCheckbox" />
			</label>

			<p>
				<f:form.textfield name="searchStr" value="{searchString}" class="tx-lfeditor-wideField" />
				<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.search')}" />
			</p>

			<f:if condition="{searchResultArray}">
				<fieldset class="tx-lfeditor-fieldset bgColor5">
					<legend class="bgColor3">
						<f:translate key="function.const.search.result" />
					</legend>

					<f:for each="{searchResultArray}" as="data" key="langKey">
						<fieldset class="bgColor4">
							<legend class="bgColor3">
								{f:if(condition: '{langKey} == \'default\'', then: 'en', else: '{langKey}')}
							</legend>
							<dl>
								<f:for each="{data}" as="constantLabel" key="constantKey">
									<dt>
										<f:link.action action="prepareEditConstant"
											controller="EditConstant"
											arguments="{constantKey: '{constantKey}'}">
											{constantKey}
										</f:link.action>
									</dt>
									<dd>{constantLabel}</dd>
								</f:for>
							</dl>
						</fieldset>
					</f:for>
				</fieldset>
			</f:if>
		</f:form>
	</lfe:extendedIf>
</f:section>